package com.hc.handler;

import com.hc.ex.WeGoArgumentException;
import com.hc.utils.JsonUtil;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Map;

/**
 * @ClassName:{NAME}
 * @Author:鹿建文
 * @Date:2022/5/12
 * @Describe:
 */
@Component
@ControllerAdvice
public class WeGoArgumentExceptionHandler {
    @ResponseBody
    @ExceptionHandler(WeGoArgumentException.class)
    public Map<String, String> proess(WeGoArgumentException ex){
        Map<String, String> map = ex.getMap();
        return map;
    }
}
